import request from '@/utils/request'

// 微信公众号用户开始---------------------------
export function getWxUsers(params) {
  return request({
    url: '/wechat/wxuser/',
    method: 'GET',
    params
  })
}

export function addWxUser(data) {
  return request({
    url: '/wechat/wxuser/',
    method: 'POST',
    data
  })
}

export function updateWxUser(data) {
  return request({
    url: `/wechat/wxuser/${data.id}/`,
    method: 'PUT',
    data
  })
}

export function delWxUser(id) {
  return request({
    url: `/wechat/wxuser/${id}/`,
    method: 'DELETE',
  })
}

export function delWxUsers(data) {
  return request({
    url: '/wechat/wxuser/batch_delete/',
    method: 'DELETE',
    data
  })
}

export function getUserInfos() {
  return request({
    url: '/wechat/userinfo/',
    method: 'GET',
  })
}
// 微信公众号用户结束----------------------------


// // 微信菜单开始---------------------------
export function getMenu() {
  return request({
    url: '/wechat/menu/',
    method: 'GET',
  })
}


export function createMenu(data) {
  return request({
    url: '/wechat/menu/',
    method: 'POST',
    data,
  })
}

export function deleteMenu(data) {
  return request({
    url: '/wechat/menu/',
    method: 'POST',
    data
  })
}

// 微信图片轮播开始---------------------------
export function getSwipeImages(params) {
  return request({
    url: '/wechat/swipe_image/',
    method: 'GET',
    params
  })
}

export function addSwipeImage(data) {
  return request({
    url: '/wechat/swipe_image/',
    method: 'POST',
    data
  })
}

export function updateSwipeImage(data) {
  return request({
    url: `/wechat/swipe_image/${data.id}/`,
    method: 'PUT',
    data
  })
}

export function delSwipeImage(id) {
  return request({
    url: `/wechat/swipe_image/${id}/`,
    method: 'DELETE',
  })
}

// export function swipeImageUpload(id) {
//   return request({
//     url: `/wechat/swipe_image/${id}/`,
//     method: 'DELETE',
//   })
// }

// 微信图片轮播结束----------------------------

// 充值金额设置开始
export function getRecharges(params) {
  return request({
    url: '/wechat/recharge_list/',
    method: 'GET',
    params
  })
}

export function addRecharge(data) {
  return request({
    url: '/wechat/recharge_list/',
    method: 'POST',
    data
  })
}

export function updateRecharge(data) {
  return request({
    url: `/wechat/recharge_list/${data.id}/`,
    method: 'PUT',
    data
  })
}

export function delRecharge(data_id) {
  return request({
    url: `/wechat/recharge_list/${data_id}/`,
    method: 'DELETE',
  })
}

export function delRecharges(data) {
  return request({
    url: '/wechat/recharge_list/batch_delete/',
    method: 'DELETE',
    data
  })
}

// 充值金额设置结束


// 用户充值记录开始
export function getRechargeRecords(params) {
  return request({
    url: '/wechat/recharge_record/',
    method: 'GET',
    params
  })
}


export function delRechargeRecords(data) {
  return request({
    url: '/wechat/recharge_record/batch_delete/',
    method: 'DELETE',
    data
  })
}
// 用户充值记录结束

// 微信统一下单结果开始

export function getUnifiedOrderResults(params) {
  return request({
    url: '/wechat/unified_order/',
    method: 'GET',
    params
  })
}

export function delUnifiedOrderResults(data) {
  return request({
    url: '/wechat/unified_order/batch_delete/',
    method: 'DELETE',
    data
  })
}

// 微信统一下单结果结束

// 微信支付结果开始

export function getPayResults(params) {
  return request({
    url: '/wechat/pay_result/',
    method: 'GET',
    params
  })
}

export function delPayResults(data) {
  return request({
    url: '/wechat/pay_result/batch_delete/',
    method: 'DELETE',
    data
  })
}
// 微信支付结果结束


// 客户账户历史信息开始

export function getHisAccounts(params) {
  return request({
    url: '/wechat/account_his/',
    method: 'GET',
    params
  })
}

export function delHisAccounts(data) {
  return request({
    url: '/wechat/account_his/batch_delete/',
    method: 'DELETE',
    data
  })
}
// 客户账户历史信息结束